package com.atguigu.algorithm;

import java.util.Scanner;

public class SendEmail {
    public static long findEmail(int n){
        if(n==0 || n==1)return 0;
        if(n==2)return 1;
        return (n-1)*(findEmail(n-1)+findEmail(n-2));
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextInt()){
            int n=scanner.nextInt();
            System.out.println(findEmail(n));
        }
    }
}
